﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Licenta_Stomatologie.Forms
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
            initialChecks();
            panelInit();
        }

        private void panelInit()
        {
            splitContainer1.Panel2.Controls.Add(new Panels.Dashboard());
        }

        private void initialChecks()
        {
            if (Helpers.StaticFunctions.checkIfFirstRun())
            {
                Console.WriteLine("Check is true");
                DialogResult result = MessageBox.Show(Helpers.UserMessages.FIRST_TIME_RUN_MESSAGE,"Prima rulare a aplicatiei", MessageBoxButtons.OKCancel);
                if ( result == DialogResult.OK )
                    Application.Run(new Forms.CompanyScreen());
            } 
        }

        private void editDetailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.CompanyEditPanel());
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result = System.Windows.Forms.MessageBox.Show("Sunteti sigur ca doriti sa parasiti aplicatia?", "Parasire aplicatie", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                Application.Exit();
            } 
       }

        private void genereazaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Helpers.PDFGenerator gen = new Helpers.PDFGenerator();

            gen.generatePDF();
        }

        private void creazaPacientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.PacientCreatePanel());
        }

        private void cautarePacientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.PacientSearchPanel());          
        }

        private void creazaProgramareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.AppointmentCreatePanel());
        }

        private void programariToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.AppointmentMainPanel());
        }

        private void button1_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.PacientSearchPanel()); 
        }

        private void button2_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.AppointmentMainPanel());
        }

        private void button3_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.Incasari());
        }

        private void creazaRetetaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(new Panels.ReceiptPanel());
        }

      
    }
}
